Skip to content

feat(scripts): add an end-to-end upgrade check - #264

Merged
matrixise merged 2 commits into
masterfrom
chore/upgrade-check-script
Nov 21, 2026
Merged

matrixise merged 2 commits into
masterfrom
chore/upgrade-check-script

Conversation

@matrixise

Copy link
Copy Markdown
Contributor

Why

The unit tests do not cover the Wagtail admin or page rendering, so every Wagtail/Django upgrade needs a manual check. This PR turns the check done for #262 (Wagtail 8.1) into a reusable script.

Usage

From the checkout of an upgrade branch:

task upgrade:check                  # compare against master
task upgrade:check BASE=<ref>       # compare against another ref
task upgrade:check -- --docker      # also build the Docker image

The script exits with status 0 on success and 1 on failure. Logs, HTML snapshots and screenshots are kept in a temporary run directory.

What it does

  1. Starts a disposable PostgreSQL 17 container.
  2. Checks out the base ref in a temporary worktree, migrates and seeds representative content (page tree, draft, rich text with links and embedded image, PNG/WebP images, document, snippets, sponsor, redirect) with the old dependencies.
  3. With the current checkout: lists and applies pending migrations, runs check, makemigrations --check and collectstatic --clear.
  4. Diffs the rendered public pages before and after the upgrade.
  5. Runs the server with DEBUG off and drives the admin with Playwright: login, page explorer, listing and search, rich-text edit and publish, page creation, preview, history, draft, snippets, images, documents, settings, Django admin, public pages, redirect and 404.
  6. Fails on any failed step, any 4xx/5xx response from the app, or a traceback in the server log.

The container, server and temporary worktree are always cleaned up.

See scripts/upgrade-check/README.md for requirements and configuration.

Files

  • scripts/upgrade-check/run.sh: orchestration
  • scripts/upgrade-check/seed.py, snapshot.py, browser_check.py: seed data, HTML snapshots, browser steps
  • scripts/upgrade-check/upgrade_check_settings.py, upgrade_check_urls.py: settings and URLs for the check
  • Taskfile.yaml: upgrade:check task

Tested

Ran it on the #262 branch (Wagtail 7.3.4 → 8.1) against master, with and without --docker. All 12 browser steps pass, the HTML is identical before and after, and the cleanup leaves no container, server or worktree behind.

🤖 Generated with Claude Code

The unit tests do not cover the Wagtail admin or page rendering, so
dependency upgrades (Wagtail, Django) had to be checked by hand.

scripts/upgrade-check/run.sh automates it:

- start a disposable PostgreSQL 17 container
- migrate and seed representative content with the base ref (master by
  default) in a temporary worktree
- with the current checkout: apply the pending migrations, run check,
  makemigrations --check and collectstatic --clear
- diff the rendered public pages before and after the upgrade
- run the server with DEBUG off and drive the admin with Playwright
  (explorer, rich text editing and publishing, page creation, preview,
  history, snippets, images, documents, settings, Django admin,
  public pages, redirect and 404)

Exposed as `task upgrade:check`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The settings never need a Redis client, and fakeredis is being removed
from the dev dependencies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matrixise
matrixise merged commit f7373df into master Nov 21, 2026
4 checks passed
@matrixise
matrixise deleted the chore/upgrade-check-script branch November 21, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant